home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: news.sprintlink.net!eskimo!scs
- From: scs@eskimo.com (Steve Summit)
- Subject: Re: void main() and other atrocities!
- X-Nntp-Posting-Host: eskimo.com
- Message-ID: <DMHDJs.GrI@eskimo.com>
- Sender: news@eskimo.com (News User Id)
- Organization: schmorganization
- References: <4erjn2INN38b@keats.ugrad.cs.ubc.ca> <9602021300.AA04359@dxmint.cern.ch> <4f5vc2$qcj@cdn_news.telecom.com.au>
- Date: Thu, 8 Feb 1996 23:35:52 GMT
-
- In article <4f5vc2$qcj@cdn_news.telecom.com.au>, jolson@vprpmel1.telecom.com.au
- (Jeff Olson) writes:
- > How about:
- > int main (int argc, char **argv)
- > I saw in the FAQ that a multi-dimentional array will not decay into
- > a pointer to a pointer.
-
- Right.
-
- > This main() is valid with my Sparcworks compiler so I would like to
- > know if my compiler is supporting non-standard behavior
-
- Not at all (not on this score, anyway).
-
- > or if argv is a pointer to an array of characters...
-
- Almost.
-
- Up in main's caller, argv is either a pointer to some pointers to
- some characters or an array of pointers to characters. (We can't
- tell, and we don't care; it's not our business.) In either case,
- argv is passed to main() as a char **, which the alternate
- declaration char *argv[] is compatible with.
-
- It's true, if argv up in main's caller were an array of arrays of
- characters, then it would be passed to main() as a pointer to
- arrays of characters (char (*)[N], or equivalently char [][N])
- which would be (and is) quite a different animal (especially
- since keeping track of the value of N would be a terrible,
- terrible nuisance).
-
- Steve Summit
- scs@eskimo.com
-
- February 8, 1996: A dark day for the net
-